<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
		              
        switch ($tela) {
			case "usuarios" :
			
				$this->form_validation->set_rules('nome','NOME','trim|required|max_length[50]|ucwords');
				$this->form_validation->set_rules('end_email','Email','trim|max_length[50]|ucwords|strtolower|valid_email');
				$this->form_validation->set_rules('sexo','SEXO','trim|required|alpha|max_length[1]|ucwords');
				$this->form_validation->set_rules('dt_nascimento','Nascimento','trim|required|max_length[10]');
				$this->form_validation->set_rules('orgao_expeditor','Orgão Expeditor','trim|strtoupper');
				
				if($objeto != "Edição de Usuarios"){
					$this->form_validation->set_rules('rg','Rg','trim|required|valid_rg|is_unique[usuario.rg]');
					$this->form_validation->set_rules('cpf','Cpf','trim|required|valid_cpf|is_unique[usuario.cpf]');
				}
				$this->form_validation->set_rules('referencia','Referencia','trim|ucwords');
				$this->form_validation->set_rules('bairro','Bairro','trim|ucwords');
				$this->form_validation->set_rules('cidade','Cidade','trim|ucwords');
			break;	
			
		}
		
        ?>